#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   NRC22_Fun_test.py
@Time    :   2024/08/16 13:31:28
@Author  :   YangLiang 
@Version :   1.0
@Contact :   yangliang@chengtech.com
@License :   (C)Copyright 2022-2025
@Desc    :   None
'''

# here put the import lib
from pytest_assume.plugin import assume

import pytest
import logging
import time
import requests
from sympy import I
# from sympy import assuming
from commDriver.TS_CAN import *
import allure
import sys
from collections.abc import Iterable

from sqlalchemy import false
sys.dont_write_bytecode = True


CommunicationControl = [([0x28, 0x00, 0x01],[0x7F, 0x28, 0x22],[0x68]),
                        ([0x28, 0x01, 0x01],[0x7F, 0x28, 0x22],[0x68]),
                        ([0x28, 0x03, 0x01],[0x7F, 0x28, 0x22],[0x68]),
                        ([0x28, 0x80, 0x01],[0x7F, 0x28, 0x22],[]),
                        ([0x28, 0x81, 0x01],[0x7F, 0x28, 0x22],[]),
                        ([0x28, 0x83, 0x01],[0x7F, 0x28, 0x22],[]),
                        ]


ControlDTCSetting = [   ([0x85, 0x01],[0x7F, 0x85, 0x22],[0xC5]),
                        ([0x85, 0x02],[0x7F, 0x85, 0x22],[0xC5]),
                        ([0x85, 0x81],[0x7F, 0x85, 0x22],[]),
                        ([0x85, 0x82],[0x7F, 0x85, 0x22],[]),
                        ]

@allure.severity('critical')
class Test_NRC22_Fun(object):

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.story('ECU NRC 22 Test')
    @allure.title('Test 0x10 Service Undervoltage condition ')
    @allure.description('Test 0x10 Service Undervoltage confition response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_UnderVoltage_Programming_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 6.3, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')

        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.story('ECU NRC 22 Test')
    @allure.title('Test 0x10 Service Undervoltage condition ')
    @allure.description('Test 0x10 Service Undervoltage confition response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_UnderVoltage_Extended_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 6.3, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')

        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')
     
    
    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x10 Service OverVoltage condition ')
    @allure.description('Test 0x10 Service OverVoltage confition response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_OverVoltage_Programming_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 18.5, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')
     
    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x10 Service OverVoltage condition ')
    @allure.description('Test 0x10 Service OverVoltage confition response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_OverVoltage_Extended_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 18.5, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.story('ECU NRC 22 Test')
    @allure.title('Test 0x10 Service Undervoltage condition ')
    @allure.description('Test 0x10 Service Undervoltage confition response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_UnderVoltage_Programming_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 6.3, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')

        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.story('ECU NRC 22 Test')
    @allure.title('Test 0x10 Service Undervoltage condition ')
    @allure.description('Test 0x10 Service Undervoltage confition response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_UnderVoltage_Extended_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 6.3, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')

        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')
     
    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x10 Service OverVoltage condition ')
    @allure.description('Test 0x10 Service OverVoltage confition response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_OverVoltage_Programming_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 18.5, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x10 Service OverVoltage condition ')
    @allure.description('Test 0x10 Service OverVoltage confition response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_OverVoltage_Extended_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 18.5, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed over 3kph condition ')
    @allure.description('Test 0x28 Service Vspeed over 3kph confition response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_OverVspeed_Programming_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x3E, 0x00], [0x7E, 0x00], 2, iStep, False,'UDSFun', 'noClearFault')
        #设置车速大于3KM/H
        iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',80,iStep)

        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')
        #设置车速为0KM/H
        iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',0,iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed over 3kph condition ')
    @allure.description('Test 0x28 Service Vspeed over 3kph confition response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_OverVspeed_Extended_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x3E, 0x00], [0x7E, 0x00], 3, iStep, False,'UDSFun', 'noClearFault')
        #设置车速大于3KM/H
        iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',80,iStep)

        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')
        #设置车速为0KM/H
        iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',0,iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed over 3kph condition ')
    @allure.description('Test 0x85 Service Vspeed over 3kph confition response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_OverVspeed_Programming_Fun(self, action, Driver, req, resp, resp2):
        iStep = 1
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x3E, 0x00], [0x7E, 0x00], 2, iStep, False,'UDSFun', 'noClearFault')

        #设置车速大于3KM/H
        iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',80,iStep)
        
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')

        #设置车速为0KM/H
        iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',0,iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed over 3kph condition ')
    @allure.description('Test 0x85 Service Vspeed over 3kph confition response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_OverVspeed_Extended_Fun(self, action, Driver, req, resp, resp2):
        iStep = 1
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x3E, 0x00], [0x7E, 0x00], 3, iStep, False,'UDSFun', 'noClearFault')

        #设置车速大于3KM/H
        iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',80,iStep)
        
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')

        #设置车速为0KM/H
        iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',0,iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    # '''P档下NRC22'''
    # ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    # @allure.title('Test 0x28 Service Gear Not P ')
    # @allure.description('Test 0x28 Service Gear Not P response NRC22 in programming session with functional addressing')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    # @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    # def test_SID28_GearNotP_Programming_Fun(self, action, Driver,req,resp,resp2):
    #     iStep = 1
    #     iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False,'UDSFun', 'noClearFault')
    #     #设置车速大于3KM/H
    #     iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',2,iStep)

    #     iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')
    #       #设置车速为0KM/H
    #     iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',1,iStep)
    #     iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    # ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    # @allure.title('Test 0x28 Service Gear Not P ')
    # @allure.description('Test 0x28 Service Gear Not P response NRC22 in extended session with functional addressing')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    # @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    # def test_SID28_GearNotP_Extended_Fun(self, action, Driver,req,resp,resp2):
    #     iStep = 1
    #     iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False,'UDSFun', 'noClearFault')
    #     #设置车速大于3KM/H
    #     iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',2,iStep)

    #     iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')
    #     #设置车速为0KM/H
    #     iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',1,iStep)
    #     iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    # ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    # @allure.title('Test 0x85 Service Gear Not P ')
    # @allure.description('Test 0x85 Service Gear Not P response NRC22 in programming session with functional addressing')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    # @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    # def test_SID85_GearNotP_Programming_Fun(self, action, Driver, req, resp,resp2):
    #     iStep = 1
    #     iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 2, iStep, False,'UDSFun', 'noClearFault')

    #     #设置车速大于3KM/H
    #     iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',2,iStep)
          
    #     iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')

    #       #设置车速为0KM/H
    #     iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',1,iStep)
    #     iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    # ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    # @allure.title('Test 0x85 Service Gear Not P ')
    # @allure.description('Test 0x85 Service Gear Not P response NRC22 in extended session with functional addressing')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    # @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    # def test_SID85_GearNotP_Extended_Fun(self, action, Driver, req, resp,resp2):
    #     iStep = 1
    #     iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False,'UDSFun', 'noClearFault')

    #       #设置车速大于3KM/H
    #     iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',2,iStep)
          
    #     iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')

    #       #设置车速为0KM/H
    #     iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',1,iStep)
    #     iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    '''3E 80'''
    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.story('ECU NRC 22 Test')
    @allure.title('Test 0x10 Service Undervoltage condition ')
    @allure.description('Test 0x10 Service Undervoltage confition response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_UnderVoltage_Programming_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 6.3, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')

        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.story('ECU NRC 22 Test')
    @allure.title('Test 0x10 Service Undervoltage condition ')
    @allure.description('Test 0x10 Service Undervoltage confition response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_UnderVoltage_Extended_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 6.3, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')

        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')
     
    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x10 Service OverVoltage condition ')
    @allure.description('Test 0x10 Service OverVoltage confition response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_OverVoltage_Programming_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 18.5, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x10 Service OverVoltage condition ')
    @allure.description('Test 0x10 Service OverVoltage confition response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_OverVoltage_Extended_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 18.5, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.story('ECU NRC 22 Test')
    @allure.title('Test 0x10 Service Undervoltage condition ')
    @allure.description('Test 0x10 Service Undervoltage confition response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_UnderVoltage_Programming_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 6.3, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')

        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.story('ECU NRC 22 Test')
    @allure.title('Test 0x10 Service Undervoltage condition ')
    @allure.description('Test 0x10 Service Undervoltage confition response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_UnderVoltage_Extended_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 6.3, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')

        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x10 Service OverVoltage condition ')
    @allure.description('Test 0x10 Service OverVoltage confition response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_OverVoltage_Programming_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 18.5, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault') 
     
    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x10 Service OverVoltage condition ')
    @allure.description('Test 0x10 Service OverVoltage confition response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_OverVoltage_Extended_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 18.5, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False,'UDSFun', 'noClearFault')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed over 3kph condition ')
    @allure.description('Test 0x28 Service Vspeed over 3kph confition response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_OverVspeed_Programming_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x3E, 0x80], [], 2, iStep, False,'UDSFun', 'noClearFault')
        #设置车速大于3KM/H
        iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',80,iStep)

        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')
        #设置车速为0KM/H
        iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',0,iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Vspeed over 3kph condition ')
    @allure.description('Test 0x28 Service Vspeed over 3kph confition response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_OverVspeed_Extended_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x3E, 0x80], [], 3, iStep, False,'UDSFun', 'noClearFault')
        #设置车速大于3KM/H
        iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',80,iStep)

        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')
        #设置车速为0KM/H
        iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',0,iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed over 3kph condition ')
    @allure.description('Test 0x85 Service Vspeed over 3kph confition response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_OverVspeed_Programming_Send3E80_Fun(self, action, Driver, req, resp, resp2):
        iStep = 1
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x3E, 0x80], [], 2, iStep, False,'UDSFun', 'noClearFault')

        #设置车速大于3KM/H
        iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',80,iStep)
        
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')

        #设置车速为0KM/H
        iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',0,iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Vspeed over 3kph condition ')
    @allure.description('Test 0x85 Service Vspeed over 3kph confition response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_OverVspeed_Extended_Send3E80_Fun(self, action, Driver, req, resp, resp2):
        iStep = 1
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x3E, 0x80], [], 3, iStep, False,'UDSFun', 'noClearFault')

        #设置车速大于3KM/H
        iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',80,iStep)
        
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')

        #设置车速为0KM/H
        iStep = Driver['CAN'].setSignalValue('IPB_0x10C','Vehicle_speed',0,iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    
    '''非P档下NRC22'''
    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Gear Not P ')
    @allure.description('Test 0x28 Service Gear Not P response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_GearNotP_Programming_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False,'UDSFun', 'noClearFault')
        #设置车速大于3KM/H
        iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',2,iStep)

        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')
          #设置车速为0KM/H
        iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',1,iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in CommunicationControl]
    @allure.title('Test 0x28 Service Gear Not P ')
    @allure.description('Test 0x28 Service Gear Not P response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', CommunicationControl, ids=ids)
    def test_SID28_GearNotP_Extended_Send3E80_Fun(self, action, Driver,req,resp,resp2):
        iStep = 1
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False,'UDSFun', 'noClearFault')
        #设置车速大于3KM/H
        iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',2,iStep)

        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')
        #设置车速为0KM/H
        iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',1,iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Gear Not P ')
    @allure.description('Test 0x85 Service Gear Not P response NRC22 in programming session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_GearNotP_Programming_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 2, iStep, False,'UDSFun', 'noClearFault')

        #设置车速大于3KM/H
        iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',2,iStep)
          
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')

          #设置车速为0KM/H
        iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',1,iStep)
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

    ids = ["Request {}".format(binascii.b2a_hex(bytearray(req), ' '))for req,resp,resp2 in ControlDTCSetting]
    @allure.title('Test 0x85 Service Gear Not P ')
    @allure.description('Test 0x85 Service Gear Not P response NRC22 in extended session with functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,resp,resp2', ControlDTCSetting, ids=ids)
    def test_SID85_GearNotP_Extended_Send3E80_Fun(self, action, Driver, req, resp,resp2):
        iStep = 1
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False,'UDSFun', 'noClearFault')

          #设置车速大于3KM/H
        iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',2,iStep)
          
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp, 0, iStep, False,'UDSFun', 'noClearFault')

          #设置车速为0KM/H
        iStep = Driver['CAN'].setSignalValue('VCU_0x05A','Rnk_hw',1,iStep)
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, req, resp2, 0, iStep, False,'UDSFun', 'noClearFault')

